from django.contrib import admin

# Register your models here.
from .models import TextModel, CommentModel


class CommentInline(admin.TabularInline):
    model = CommentModel
    extra = 3


class TextModelAdmin(admin.ModelAdmin):
   list_display = ( "title","pub_time", "read_num", "like_num")
   list_filter = ["pub_time"]
   inlines = [CommentInline]
   search_fields = ["Content"]


admin.site.register(TextModel,TextModelAdmin)
admin.site.register(CommentModel)
